home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: cs.chalmers.se!news.chalmers.se!sunic!uunet!haven.umd.edu!darwin.sura.net!news-feed-1.peachnet.edu!concert!sas!mozart.unx.sas.com!walker
- From: walker@twix.unx.sas.com (Doug Walker)
- Subject: Re: CTRL-C Trapping
- Originator: walker@twix.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <C7Mvxz.1yq@unx.sas.com>
- Date: Wed, 26 May 1993 12:27:34 GMT
- References: <dave.03zr@ddreams.UUCP>
- Nntp-Posting-Host: twix.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 32
-
-
- In article <dave.03zr@ddreams.UUCP>, dave@ddreams.UUCP (David Prothero) writes:
- |> Quick, easy question...
- |>
- |> How do I trap a CTRL-C on a program that runs from the CLI so that I can do
- |> some clean up on my program before I exit?
- |>
- |> Thanks... reply here or via e-mail.
-
- You don't say what language you are using. This is very important
- information! Please give us enough information to help you when
- you ask the question.
-
- If you are using C, your compiler's library is trapping CTRL-C for
- you and exiting. Look in your library documentation for information
- on how to control this.
-
- In SAS/C 6.0, you would simply declare a function like so:
-
- void __regargs _CXBRK(void)
- {
- /* Do your cleanup here */
- }
-
- --
- ***** / walker@unx.sas.com
- *|_o_o|\\ Doug Walker< BIX, Portal: djwalker
- *|. o.| || \ CompuServe: 71165,2274
- | o |//
- ======
- Any opinions expressed are mine, not those of SAS Institute, Inc.